package com.carlife.algorithm;

public class FittingFactory {
	
	public static Fitting getFitting(String fittingNameClass) {
		
		Fitting instance = null;
		
		try {
			instance = (Fitting)FittingFactory.class.forName(fittingNameClass).newInstance();
		} catch (Exception e) {
			instance = new StraitLineFitting();
		}
		
		return instance;
	}
	
	public static Fitting getDefaultFitting() {
		return new StraitLineFitting();
	}

}
